#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;

int GetMonthDay(int year, int month)
{
	int array_day[13] = { 0,31,27,31,30,31,30,31,31,30,31,30,31 };
	if (month == 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0))
	{
		return 29;
	}
	return array_day[month];
}
int main()
{
	cout << GetMonthDay(2000, 2) << endl;
	cout << GetMonthDay(2021, 2) << endl;
	cout << GetMonthDay(2024, 5) << endl;
	cout << GetMonthDay(2024, 6) << endl;
	cout << GetMonthDay(2021, 12) << endl;
	return 0;
}